<template>
  <div class="conitainer">
    <top-Title
      :titleText="`违法记载详情`"
      :back="true"
      @gobackTriser="goBack"
    ></top-Title>
    <div class="mainCon">
      <el-form :model="formData" ref="formData" class="demo-formData">
        <table cellspacing="0" cellpadding="0">
          <tbody>
            <tr>
              <td class="title">项目名称</td>
              <td>{{ formData.projectName || '--' }}</td>
              <td class="title">施工方名称</td>
              <td>{{ formData.pbName || '--' }}</td>
            </tr>
            <tr>
              <td class="title">发生地区</td>
              <td>{{ formData.address || '--' }}</td>
              <td class="title">施工方统一社会信用代码</td>
              <td>{{ formData.pbUscc || '--' }}</td>
            </tr>
            <tr>
              <td class="title">行业</td>
              <td>{{ formData.industry || '--' }}</td>
              <td class="title">
                {{
                  formData.responsibilityType === 'COMPANY'
                    ? '责任主体统一社会信用代码'
                    : '责任主体身份证号码'
                }}
              </td>
              <td>{{ formData.uscc || '--' }}</td>
            </tr>
            <tr>
              <td class="title">事项时间</td>
              <td>{{ formData.disputeDate }}</td>
              <td class="title">
                {{
                  formData.responsibilityType === 'COMPANY'
                    ? '责任主体企业名称'
                    : '责任主体姓名'
                }}
              </td>
              <!-- <td class="title">责任主体企业名称</td> -->
              <!-- <td>{{formData.companyName || '--'}}</td> -->
              <td>
                {{
                  formData.companyName +
                    '(' +
                    formData.responsibilityTypeDesc +
                    ')' || '--'
                }}
              </td>
            </tr>
            <tr>
              <td class="title">是否下达整改文书</td>
              <td>{{ formData.isCorrected == 1 ? '是' : '否' || '--' }}</td>

              <td class="title">事项程度</td>
              <td v-if="formData.disputeRank == '一般'" class="general">
                {{ formData.disputeRank || '--' }}
              </td>
              <td v-else-if="formData.disputeRank == '重大'" class="import">
                {{ formData.disputeRank || '--' }}
              </td>
              <td v-else-if="formData.disputeRank == '严重'" class="serious">
                {{ formData.disputeRank || '--' }}
              </td>
            </tr>
            <tr>
              <td class="title">是否欠薪</td>
              <td>
                {{
                  formData.isBackPay
                    ? '是 （涉及金额：' +
                      formData.balance +
                      '元，涉及人数：' +
                      formData.peopleTotal +
                      '人）'
                    : '否'
                }}
              </td>
              <td class="title">是否约谈</td>
              <td>{{ formData.isInterviewed == 1 ? '是' : '否' || '--' }}</td>
            </tr>
            <tr>
              <td class="title">是否强制执行</td>
              <td>{{ formData.isEnforced == 1 ? '是' : '否' || '--' }}</td>
              <td class="title">是否处理</td>
              <td>{{ formData.isHandled == 1 ? '是' : '否' || '--' }}</td>
            </tr>
            <tr>
              <td class="title">是否移交公安</td>
              <td>{{ formData.isTransfered == 1 ? '是' : '否' || '--' }}</td>
              <td class="title">是否立案</td>
              <td>{{ formData.isRegistered == 1 ? '是' : '否' || '--' }}</td>
            </tr>
            <tr>
              <td class="title">事项类别</td>
              <td>{{ formData.preciseTypeName || '--' }}</td>
              <td class="title">是否处罚</td>
              <td>{{ formData.isPunished == 1 ? '是' : '否' || '--' }}</td>
            </tr>
            <tr>
              <td class="title">案号</td>
              <td colspan="4">{{ formData.reference || '--' }}</td>
            </tr>
            <tr>
              <td class="title">事项情况</td>
              <td colspan="4">{{ formData.illustration || '--' }}</td>
            </tr>
            <tr>
              <td class="title">上传事项资料</td>
              <td colspan="4">
                <template v-for="(item, index) in formData.file">
                  <div class="interval" :key="index">
                    <a
                      target="_blank"
                      class="a_link mouseOn"
                      :href="item.absolutePath"
                      >{{ item.originalName || '--' }}</a
                    >
                  </div>
                </template>
              </td>
            </tr>
            <tr>
              <td class="title">添加人</td>
              <td>{{ formData.creatorName || '--' }}</td>
              <td class="title">添加时间</td>
              <td v-if="formData.createTime">
                {{ common.GMTFormat(formData.createTime, true) || '--' }}
              </td>
            </tr>
          </tbody>
        </table>
      </el-form>
    </div>
  </div>
</template>
<script>
import common from '@/kits/common'

import topTitle from '@/components/publicCom/topTitle'

export default {
  name: 'illegalRecordDetail',
  components: {
    topTitle,
  },
  data() {
    return {
      formData: {},
    }
  },
  methods: {
    getDetail(id) {
      this.axios({
        method: 'post',
        url: 'api-r/rightsdispute/expand/detailbycompany',
        data: {
          id: id,
        },
      })
        .then((response) => {
          this.formData = response.data.result
        })
        .catch((error) => {
          console.log(error)
        })
    },
    getClass(str) {
      if (str == '一般') {
        return 'info general'
      } else if (str == '重大') {
        return 'info import'
      } else if (str == '严重') {
        return 'info serious'
      }
    },
    goBack() {
      this.$router.push('/home/illegal/illegalRecord')
      this.$store.commit('CHANGE_SLIDER_NAME', {
        oldUrl: '/home/illegal/illegalRecord',
        newUrl: this.$router.currentRoute.fullPath,
      })
    },
  },
  mounted() {
    this.id = this.$route.query.id
    this.getDetail(this.id)
  },
}
</script>
<style lang="less" scoped>
.container {
  .mainCon {
    height: calc(100% - 67px);
    padding: 24px;
    color: #333;
    font-size: 14px;
  }
}
form.el-form.demo-formData {
  width: 100%;
  display: inline-block;
  text-align: left;
  .a_link {
    color: #00a0e9;
  }
  table {
    width: 100%;
    border-top: 1px solid #d5dfe8;
    border-left: 1px solid #d5dfe8;
    td {
      padding: 0 18px;
      height: 41px;
      line-height: 41px;
      border-bottom: 1px solid #d5dfe8;
      border-right: 1px solid #d5dfe8;
    }
    .title {
      width: 220px;
      background-color: #f5f7fc;
      font-weight: 500;
      text-align: right;
    }
    .general {
      color: #6dd400;
    }
    .import {
      color: #fa6400;
    }
    .serious {
      color: #e02020;
    }
  }
}
.el-main .el-form-item {
  margin-bottom: 20px;
}
</style>
